<template>
	<div>
		<van-nav-bar
		  title="标题"
		  left-text="返回"
		  
		  left-arrow
		  @click-left="$router.go(-1)"
		  
		/>
		<van-swipe :autoplay="3000" height='250'>
		  <van-swipe-item v-for="(image, index) in goods.img" @click="preview" :key="index">
		    <img :src="image" />
		  </van-swipe-item>
		</van-swipe>
		<van-row>
		  <van-col span="24"><h3>{{goods.content}}</h3></van-col>
		  
		</van-row>
		<van-notice-bar
		  left-icon="volume-o"
		  text="618全场6.8折,大优惠"
		/>
		<van-row type='flex' align='center'>
		  <van-col span="12"><h3>{{goods.content}}</h3></van-col>
		  <van-col span="4">{{goods.price}}</van-col>
		  <van-col span="8">
			  <van-button type="primary" @click='addToCart'>加入购物车</van-button>
		  </van-col>
		  
		</van-row>
	</div>
</template>

<script>
	import { ImagePreview } from 'vant';
	import { mapActions } from 'vuex';
	export default {
		data(){
			return{
				images:[
					
				],
				goods:''
			}
		},
		created() {
			this.images = this.$request.bannerList;
			
			this.goods = this.$route.query.goods;
			console.log(this.goods)
		},
		
		methods:{
			...mapActions(['addCart']),
			addToCart(){
				this.addCart(this.goods);
			},
			preview(){
				ImagePreview(this.goods.img);
			},
			
		}
	}
</script>

<style>
</style>
